﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="DC_DisciplineCommand.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.DC_DisciplineCommand" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>
<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  

    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js" />
    
    <script type="text/javascript">   

        function isNumberKey(event)  // ตัวเลขอย่างเดียว
        {
            var charCode = (event.which) ? event.which : event.keyCode
            if(charCode > 31 && (charCode < 48 || charCode > 57)){
    //          alert("กรอกได้แต่ตัวเลขครับ!")
                return false;
	        }
            return true;
        }
        function onTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
        } 
        function openProjectDetails(idCmd,idEmp)
        {
            var time;
            time = new Date().getTime();  
                
            //alert(idCmd +"|"+ idEmp);
            radopen("DC_DisciplineCommandPopup.aspx?xx=time&idC=" + idCmd +"&idE="+ idEmp ,"ProjectDtls1");
                return false;

            //maximunWindow();
        }
    </script>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow 
                id="ProjectDtls1" 
                runat="server"
                showcontentduringload="false"
                VisibleStatusbar="false"
                title="ข้อมูลผู้กระทำผิด"
                width="1100px"
                Height="600px"        
                Modal="true"
                behaviors="Close">
            </telerik:RadWindow>
        </Windows>

        <Windows>
            <telerik:RadWindow 
                ID="RadWindow1"  
                DestroyOnClose = "true"               
                Modal ="true"                
                VisibleStatusbar ="false"
                runat="server">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>    
    
    <div style="color: #003399; font-weight: normal; font-size: 20px; padding-top: 20px; padding-bottom: 20px">จัดทำคำสั่งลงโทษทางวินัย</div>
    <div>  </div>
    <telerik:RadGrid ID="RadGrid2" runat="server" AllowFilteringByColumn="True" AllowAutomaticDeletes="True"
        AllowMultiRowEdit="True" AllowMultiRowSelection="True" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" EnableAJAX="True" 
        EnableAJAXLoadingTemplate="True" GridLines="None" 
        OnItemCommand="RadGrid2_ItemCommand" Skin="Outlook" Width="998px" 
        onitemdatabound="RadGrid2_ItemDataBound">
        <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
            ClientDataKeyNames="cmd_seq" CommandItemDisplay="Top" DataKeyNames="cmd_seq" 
            InsertItemPageIndexAction="ShowItemOnCurrentPage" 
            NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
            <CommandItemTemplate>
                <table width="100%">
                    <tr>
                        <td>
                            <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                CommandName="InitInsert" 
                                Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>">
                            <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                style="border: 0px; vertical-align: middle;" /> จัดทำร่างคำสั่ง</asp:LinkButton>
                            &nbsp;&nbsp;
                        </td>
                        <td align="right">
                        </td>
                    </tr>
                </table>
            </CommandItemTemplate>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
  
            <ExpandCollapseColumn Visible="True">
            </ExpandCollapseColumn>
            
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                    EditText="คลิกเพื่อแก้ไขข้อมูล">
                    <ItemStyle Width="15px" />
                </telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
                    ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?" 
                    Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                    <HeaderStyle HorizontalAlign="Center" Width="10px" />
                    <ItemStyle HorizontalAlign="Center" Width="10px" />
                </telerik:GridButtonColumn>
                            
                <telerik:GridBoundColumn DataField="No" HeaderText="เลขที่" 
                    ShowFilterIcon="false"
                    FilterControlWidth="100%"
                    CurrentFilterFunction="Contains"
                    AutoPostBackOnFilter="true"
                    UniqueName="No">
                    <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="cmd_status_name" HeaderText="ประเภทคำสั่ง"
                    ShowFilterIcon="false"
                    FilterControlWidth="100%"
                    CurrentFilterFunction="Contains"
                    AutoPostBackOnFilter="true"
                    UniqueName="cmd_status_name">
                    <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                </telerik:GridBoundColumn>
                
                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" ShowFilterIcon="false" 
                    CurrentFilterFunction="Contains" DataField="cmd_name" FilterControlWidth="100%" 
                    HeaderStyle-HorizontalAlign="Center" HeaderText="เรื่อง" >
                    <ItemTemplate>              
                        <asp:LinkButton ID="targetControl" runat="server"
                            Text='<%# Eval("cmd_name") %>'
                            OnClientClick='<%# string.Format("return openProjectDetails(\"{0}\",\"{1}\");", Eval("cmd_seq"),Eval("emp_type_seq")) %>'>
                        </asp:LinkButton>
                    </ItemTemplate>                
                    <HeaderStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>
                
                <telerik:GridBoundColumn DataField="approved_name" HeaderText="อนุมัติโดย" 
                        ShowFilterIcon="false"
                    FilterControlWidth="100%"
                    CurrentFilterFunction="Contains"
                    AutoPostBackOnFilter="true"
                    UniqueName="approved_name">
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn DataField="approved_date" HeaderText="ลงวันที่" 
                    ShowFilterIcon="false"
                    FilterControlWidth="100%"
                    CurrentFilterFunction="Contains"
                    AutoPostBackOnFilter="true"
                    UniqueName="approved_date">
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn DataField="confirm" HeaderText="ยืนยัน" 
                    ShowFilterIcon="false"
                    FilterControlWidth="100%"
                    CurrentFilterFunction="Contains"
                    AutoPostBackOnFilter="true"
                    UniqueName="confirm">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="WebUserControl" 
                UserControlName="../UserControls/DC_DisciplineCommand.ascx">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
        </MasterTableView>
        <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
            EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
        </ClientSettings>
    </telerik:RadGrid>

</asp:Content>
